package Tree;

import org.junit.Test;

public class BianLi
{
    @Test
    public void test()
    {
        String path = "/ssss/";
        String pp = "/ssss/www/s/sssss/sss";
        String[] s = pp.split(path);
        if (s.length>0 && s[0].equals(""))
        {
            System.out.println("包含！");
        }
        else {
            System.out.println("不包含！");
        }
    }

    @Test
    public void test1()
    {
        String path = "/ssss/www/ssss/ssss";
        String pp = "/ssss/www/s/sssss/sss";

        String path1 = "/ssh/ssj/ss/ssshhs/ssh/ssj";
        String oldPath = "/ssh/ssj";
        String newPath = "/ssh/nimei";
        String replace = path.replace("/ssss", "");
        System.out.println(replace);

        StringBuilder stringBuilder = new StringBuilder(path1);
        StringBuilder replace1 = stringBuilder.replace(0, oldPath.length(), newPath);
        System.out.println(replace1.toString());

        if (pp.indexOf(path) == 0)
        {
            System.out.println("匹配到第一个字符串！");
        }else {
            System.out.println("没有匹配到！");
        }
    }


}
